package com.xinsilu.hospital.controller;


import com.xinsilu.common.Result;
import com.xinsilu.hospital.entity.BedTable;
import com.xinsilu.hospital.entity.DischargeTable;
import com.xinsilu.hospital.service.IDischargeTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ym
 * @since 2021-09-22
 */
@RestController
@RequestMapping("/api/hospital/dischargeTable")
public class DischargeTableController {

    @Autowired
    private IDischargeTableService iDischargeTableService;

    @RequestMapping("/tianjia")
    public Object tianjia(DischargeTable dischargeTable) {
        boolean save = iDischargeTableService.tianjia(dischargeTable);
        if(save){
            return Result.ok("成功");
        }else{
            return Result.ok("失败");
        }
    }

    @RequestMapping("/allList")
    public Object allList(DischargeTable dischargeTable){
        List<DischargeTable> list = iDischargeTableService.allList(dischargeTable);
        return Result.ok(list);
    }

    @RequestMapping("/goList")
    public Object goList(DischargeTable dischargeTable){
        List<DischargeTable> list = iDischargeTableService.goList(dischargeTable);
        return Result.ok(list);
    }

    @RequestMapping("/xiugaiqian")
    public Object xiugaiqian(DischargeTable dischargeTable) {
        boolean save = iDischargeTableService.xiugeiqian(dischargeTable);
        if(save){
            return Result.ok("成功");
        }else{
            return Result.ok("失败");
        }
    }

    @RequestMapping("/jiaofei")
    public Object jiaofei(DischargeTable dischargeTable){
        boolean save = iDischargeTableService.jiaofei(dischargeTable);
        if(save){
            return Result.ok("成功");
        }else{
            return Result.ok("失败");
        }
    }

}
